package com.personal.gateway.flinkAllCommand.flinkEnvironment;

import com.personal.gateway.custom.customEnum.flinkCommandEnum.FlinkTargetEnum;
import com.personal.gateway.flinkAllCommand.configurationOption.ConfigurationOption;
import com.personal.gateway.flinkAllCommand.configurationOption.ConfigurationOptionBuilder;
import com.personal.gateway.flinkAllCommand.configurationOption.KeyIndexInfomationDao;
import com.personal.gateway.flinkAllCommand.configurationOption.configurationGenerator.ConfigurationGeneratorString;
import com.personal.gateway.flinkAllCommand.configurationOption.configurationType.ConfigurationTypeString;
import com.personal.gateway.flinkAllCommand.configurationOption.parameterCheck.ParameterCheckString;
import com.personal.gateway.flinkAllCommand.configurationOption.webObjectGenerator.WebObjectGeneratorString;

import static com.personal.gateway.custom.customEnum.flinkCommandEnum.FlinkTargetEnum.*;
import static com.personal.gateway.flinkAllCommand.TestNewConfig.ENVIRONMENT_GROUP;

/**
 * @author BigHead
 * @date 2022/1/20 10:27
 * @description YarnEnvironment
 */
public class YarnEnvironment extends FlinkEnvironmentTypeClass {

    public final ConfigurationOption<String, ConfigurationTypeString> stringValue = ConfigurationOptionBuilder
            .startBuilder(ENVIRONMENT_GROUP, new KeyIndexInfomationDao("kubernetes.container.image", 2))
            .webShowName("Yarn")
            .describe("测试")
            .necessary(true)
            .typeString()
            .setExampleValue("a", "b", "c")
            .webObjectGenerator(WebObjectGeneratorString.class)
            .parameterCheck(ParameterCheckString.class)
            .configurationGenerator(ConfigurationGeneratorString.class)
            .build();

    @Override
    protected FlinkTargetEnum[] setFlinkTargetEnums() {
        return new FlinkTargetEnum[]{YARN_PER_JOB, YARN_SESSION, YARN_APPLICATION};
    }
}
